<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.db.schedule.*" %>
<%@ page import="java.util.Calendar" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri = "http://java.sun.com/jsp/jstl/core" %>


<%

int year=(Integer)request.getAttribute("year");
int month=(Integer)request.getAttribute("month");
int week=(Integer)request.getAttribute("week");
int ed=(Integer)request.getAttribute("ed");

%>
<%--<img src="/ssteam/image/..." --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<link rel="stylesheet" type="text/css" href="../schedule/css/shadowbox.css">

<%-- <script type="text/javascript" src="../schedule/js/shadowbox.js"></script>
<script type="text/javascript">
 Shadowbox.init({players:["iframe"]});
</script>

<script type="text/javascript">
function insert()
{
	var f=document.frm;
	Shadowbox.open(
			{
				content:"insert.do",
				player:"iframe",
				title:"",
				width:400,
				height:300
			}	
		 );
}
</script> --%>
<title>Insert title here</title>
<s:head theme="ajax"/>
</head>
<body>
<center>
<s:a href="/ssteam/schedule/schedule.do?year=%{#request.year}&month=%{#request.month-1}&sabun=%{#session.user.sabun}" theme="ajax" targets="center">
<img src="/ssteam/image/schedule/back.gif" border=0></s:a>&nbsp;
<b>${year }년&nbsp;&nbsp;${month}월</b>
<s:a href="/ssteam/schedule/schedule.do?year=%{#request.year}&month=%{#request.month+1}&sabun=%{#session.user.sabun}" theme="ajax" targets="center">
<img src="/ssteam/image/schedule/forward.gif" border=0></s:a>
<p>

<form method=post action=insert.do name=frm>
<table border=0 width=910 height=30>
<tr>
<!-- <td align=right colspan=7><a onclick=insert()>일정등록</a></td> -->

</tr>
<tr bgcolor=bbbbb>
<td align=center><font color=white>일</font></td>
<td align=center><font color=white>월</font></td>
<td align=center><font color=white>화</font></td>
<td align=center><font color=white>수</font></td>
<td align=center><font color=white>목</font></td>
<td align=center><font color=white>금</font></td>
<td align=center><font color=white>토</font></td>
</tr>
</table>


<%-- <table border=1 width=910 height=500>
<tr>
<!-- 1일까지 공백처리 -->
<c:forEach begin="1" end="${week-1}">
<td>&nbsp;</td>
</c:forEach>

<!-- 날짜 출력 -->


 <%
	for(int j=1; j<=ed; j++){
	week++;
	//줄바꿈
 if(week%7==2){
%>   
<tr>
 <%} %> 
<%if(week%7==2){ %>

<td  align=left valign="top" width=130><font color=red><a href="/ssteam/schedule/insert.do?year=%{#request.year}&month=<%=month%>&j=<%=j%>">
<%=j %></a></font><br>


</td>
<%}else if(week%7==1){ %>

<td align=left valign="top" width=130><font color=blue><a href="/ssteam/schedule/insert.do?year=%{#request.year}&month=<%=month%>&j=<%=j%>">
<%=j %></a></font><br>

</td>
<%}else{ %>
<td align=left valign="top" width=130><a href="/ssteam/schedule/insert.do?year=%{#request.year}&month=<%=month%>&j=<%=j%>">
<%=j %></a><br>

</td>


<%}%><%} %>
</tr>
</table> --%>
<table border=1 width=910 height=500>
<c:set var="j" value="1" scope="request"/>
<c:set var="type1" value="0"/>
<c:set var="type2" value="1"/>
<c:forEach var="i" begin="0" end="4" step="1">
<tr>
<c:forEach var="ii" begin="0" end="6" step="1">
<td height=13% width=130 align=left valign="top">
<c:choose>
<c:when test="${i==0 &&ii<week-1 }">
&nbsp;
</c:when>
<c:otherwise>
<c:if test="${j<=ed }">

<s:a href="/ssteam/schedule/insert.do?year=%{#request.year}&month=%{#request.month}&j=%{#request.j}" theme="ajax" targets="center">${j}</s:a><br>
<s:iterator value="list">
<%-- <c:forEach var="vo" items="${list }"> --%>	
	<c:if test="${sday2==j }">
	
	<c:if test="${type==0 }">
	
	[개]	<s:a href="/ssteam/schedule/plan.do?sno=%{sno}" theme="ajax" targets="center">${psubject}</s:a><br>
		</c:if>
	<c:if test="${type==1 }">
	
	[부]	<s:a href="/ssteam/schedule/plan.do?sno=%{sno}" theme="ajax" targets="center">${psubject}</s:a><br>
		</c:if>
		
		
	</c:if>
	
<%-- </c:forEach> --%>
</s:iterator>
<c:set var="j" value="${j+1 }" scope="request"/>
</c:if>
</c:otherwise>
</c:choose>
</td>
</c:forEach>
</tr>
</c:forEach>
</table>
 </form>
</center>
</body>
</html>